Skip to content

refactor: structure TypeScript API interfaces - #161

Open
adamcavendish wants to merge 1 commit into
adamcavendish/structure-typescript-response-dispatchfrom
adamcavendish/typescript-api-interface-emission
Open

adamcavendish wants to merge 1 commit into
adamcavendish/structure-typescript-response-dispatchfrom
adamcavendish/typescript-api-interface-emission

Conversation

@adamcavendish

Copy link
Copy Markdown
Collaborator

Summary

Migrate TypeScript Fetch API interfaces from formatted signature fragments to structural TypeSpec, FieldSpec, and CallableParam emission.

Problem

API interface methods were assembled as raw source strings because the emitter treated named callable parameters as unsupported. That bypassed structural type composition and made the interface surface a remaining exception to the generator's sigil-stitch pipeline.

Behavior

Surface Result
API interface properties Required request parameters and optional initOverrides are represented as named callable parameters.
Type and value imports Callable parameter and return types remain structural through sigil-stitch lowering and import collection.
Generated clients Request signatures, response types, class implementation, and runtime behavior remain unchanged.
Edge cases No-input, cookie-only, optional query/body, path parameters, named arrays, and nullable array items are covered.
Output changes Existing TypeScript golden differences are limited to whitespace and continuation layout within API interface declarations.

Compatibility and boundaries

  • This PR is intentionally based on PR #160; review or merge it after that base change.
  • The local sigil-stitch checkout is used only for validation. No machine-local Cargo configuration, Cargo.lock change, dependency patch, version bump, or release is included.
  • The published sigil-stitch 0.7.3 composition prerequisite documented in PR refactor: structure TypeScript response dispatch #160 remains unresolved; local fixed-checkout validation must not be treated as registry-only validation.

- Emit API interface properties through TypeSpec, FieldSpec, and named
  CallableParam values instead of formatted function-signature fragments.
- Preserve request-parameter presence, optional init overrides, type imports,
  generated APIs, and response behavior while keeping local references typed.
- Pin ordinary and edge-case interfaces with a focused fixture, exact renders,
  and updated TypeScript goldens.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant